<?php 
//ajax请求响应
isset($_POST['m_page']) or die('非法访问路径');
isset($_POST['m_item']) or die('非法访问路径');
//抽象Ajax类		2016/5/4 星期三			抽象类公共访问接口
abstract class Ajax extends Mb_conero
{
	public $p;			//当前请求页面		page
	public $m;			//当前请求项目		method
	public $bind;		//绑定数据		ajax绑定数据
	public function __construct()
	{
		$page = $_POST['m_page'];
		$this->p = $page;
		$this->m = $page;
		$ajax_req = array();
		$bind = $_POST;
		unset($bind['m_item']);unset($bind['m_page']);unset($bind['uid']);
		$this->bind = $bind;
		array_push($ajax_req,dirname(__FILE__).'/ajax/ajax_'.$page.'.php');
		array_push($ajax_req,dirname(__FILE__).'/ajax/'.$page.'.php');
		array_push($ajax_req,dirname(__FILE__).'/ajax/ajax_'.$page);
		array_push($ajax_req,dirname(__FILE__).'/ajax/'.$page);
		foreach($ajax_req as $v)
		{
			if(is_file($v)) include_once($v);
		}
	}
	//ajax数据返回封装		2016/5/6 星期五
	public  function feekback($data)
	{
		if(is_array($data)) $data = json_encode($data);
		echo $data;
		die;//防止ajax多次调用方法
	}
}



//$Action = new Ajax();//抽象类不可实例化
// 定于类来实例化对象
class Ajax_Action extends Ajax
{
	public function action()
	{
		m_model();
	}
}
$db = new Ajax_Action();
$db->action();
